
****************
*** Fig. A.1 ***
****************

* load frame
frame change italian_data


reg mainstream i.worse_econ##c.associations##i.unemp_tercile i.education age i.male i.election_year i.regionen, vce(cluster province)

margins unemp_tercile, dydx(worse_econ) at(associations=(0(4)16))
mplotoffset,  offset(0.5) recast(scatter) ///
		title("") ///
		plotregion(style(none) color(gs16)) ///
		ytitle("Mainstream vote", size(large)) ///
		xtitle("Number of associations", size(large)) ///		
		yline(0, lw(thin) lstyle(foreground) ) ///
		ylabel(, grid glcolor(black%70) glw(thin) labs(medl)) ///
		xlabel(, nogrid) ///
		aspect(1) ///
		plot1opts(msymbol(D) msize(medium) mcolor(red) lcolor(red) lwidth(medthick)) ci1opts(lcolor(red)) ///
        plot3opts(msymbol(O) msize(medium) mcolor(blue) lp(solid)  mlcolor(blue) lcolor(blue) lwidth(medthick)) ci3opts(lcolor(blue)) ///
        plot2opts(msymbol(T) msize(medium) mcolor(orange) lp(solid)  mlcolor(orange) lcolor(orange) lwidth(medthick)) ci2opts(lcolor(orange)) ///
		legend( ///
			region(lwidth(none)) ///
			col(3) ///
			position(6) ///
			order(4 "Low unemployment change" 5 "Mid unemployment change" 6 "High unemployment change"))
graph addplot histogram associations, ///
	yaxis(2) ///
	yscale(range(0 1) off axis(2)) ///
	xlabel(0(4)24) ///
	color(black%10) ///
	legend( ///
		region(lwidth(none)) ///
		col(3) ///
		position(6) ///
			order(4 "Low unemployment change" 5 "Mid unemployment change" 6 "High unemployment change"))
graph export "$folder/replication/figures/figA1a.pdf", replace

* unemployment change tercile log associations
reg mainstream i.worse_econ##c.log_associations##i.unemp_tercile i.education age i.male i.election_year i.regionen, vce(cluster province)

margins unemp_tercile, dydx(worse_econ) at(log_associations=(0.2(0.4)2.6))
mplotoffset, offset(0.05) recast(scatter) ///
		title("") ///
		ytitle("Mainstream vote", size(large)) ///
		xtitle("Log-transformed n. of associations", size(large)) ///		
		///
		yline(0, lw(thin) lstyle(foreground) ) ///
		ylabel(, grid glcolor(black%70) glw(thin) labs(medl)) ///
		xlabel(, nogrid) ///
		aspect(1) ///
		plot1opts(msymbol(D) msize(medium) mcolor(red) lcolor(red) lwidth(medthick)) ci1opts(lcolor(red)) ///
        plot3opts(msymbol(O) msize(medium) mcolor(blue) lp(solid)  mlcolor(blue) lcolor(blue) lwidth(medthick)) ci3opts(lcolor(blue)) ///
        plot2opts(msymbol(T) msize(medium) mcolor(orange) lp(solid)  mlcolor(orange) lcolor(orange) lwidth(medthick)) ci2opts(lcolor(orange)) ///
		legend( ///
			region(lwidth(none)) ///
			col(3) ///
			position(6) ///
			order(4 "Low unemployment change" 5 "Mid unemployment change" 6 "High unemployment change"))
graph addplot histogram log_associations, ///
	yaxis(2) ///
	yscale(range(0 6) off axis(2)) ///
	xlabel(0.2(0.4)2.6) ///
	color(black%10) ///
		legend( ///
			region(lwidth(none)) ///
			col(3) ///
			position(6) ///
			order(4 "Low unemployment change" 5 "Mid unemployment change" 6 "High unemployment change"))
graph export "$folder/replication/figures/figA1b.pdf", replace

* Tercile unemployment change sports club
reg mainstream i.worse_econ##c.coni_assoc_1999##i.unemp_tercile i.education age i.male i.election_year i.regionen, vce(cluster regionen)

margins unemp_tercile, dydx(worse_econ) at(coni_assoc_1999=(0.5(.4)2.1))
mplotoffset,  offset(0.05) recast(scatter) ///
		title("") ///
		ytitle("Mainstream vote", size(large)) ///
		xtitle("Number of sports clubs", size(large)) ///		
		yline(0, lw(thin) lstyle(foreground) ) ///
		ylabel(, grid glcolor(black%70) glw(thin) labs(medl)) ///
		xlabel(, nogrid) ///
		aspect(1) ///
		plot1opts(msymbol(D) msize(medium) mcolor(red) lcolor(red) lwidth(medthick)) ci1opts(lcolor(red)) ///
        plot3opts(msymbol(O) msize(medium) mcolor(blue) lp(solid)  mlcolor(blue) lcolor(blue) lwidth(medthick)) ci3opts(lcolor(blue)) ///
        plot2opts(msymbol(T) msize(medium) mcolor(orange) lp(solid)  mlcolor(orange) lcolor(orange) lwidth(medthick)) ci2opts(lcolor(orange)) ///
		legend( ///
			region(lwidth(none)) ///
			col(3) ///
			position(6) ///
			order(4 "Low unemployment change" 5 "Mid unemployment change" 6 "High unemployment change"))
graph addplot histogram coni_assoc_1999, ///
	yaxis(2) ///
	yscale(range(0 6) off axis(2)) ///
	xlabel(0.5(.4)2.1) ///
	color(black%10) ///
		legend( ///
			region(lwidth(none)) ///
			col(3) ///
			position(6) ///
			order(4 "Low unemployment change" 5 "Mid unemployment change" 6 "High unemployment change"))
graph export "$folder/replication/figures/figA1c.pdf", replace

* Tercile unemployment change sports club log
reg mainstream i.worse_econ##c.log_coni_assoc_1999##i.unemp_tercile i.education age i.male i.election_year i.regionen, vce(cluster regionen)

margins unemp_tercile, dydx(worse_econ) at(log_coni_assoc_1999=(0.4(0.3)1.2))
mplotoffset, offset(0.05) recast(scatter) ///
		title("") ///
		ytitle("Mainstream vote", size(large)) ///
		xtitle("Log-transformed n. of associations", size(large)) ///		
		yline(0, lw(thin) lstyle(foreground) ) ///
		ylabel(, grid glcolor(black%70) glw(thin) labs(medl)) ///
		xlabel(, nogrid) ///
		aspect(1) ///
		plot1opts(msymbol(D) msize(medium) mcolor(red) lcolor(red) lwidth(medthick)) ci1opts(lcolor(red)) ///
        plot3opts(msymbol(O) msize(medium) mcolor(blue) lp(solid)  mlcolor(blue) lcolor(blue) lwidth(medthick)) ci3opts(lcolor(blue)) ///
        plot2opts(msymbol(T) msize(medium) mcolor(orange) lp(solid)  mlcolor(orange) lcolor(orange) lwidth(medthick)) ci2opts(lcolor(orange)) ///
		legend( ///
			region(lwidth(none)) ///
			col(3) ///
			position(6) ///
			order(4 "Low unemployment change" 5 "Mid unemployment change" 6 "High unemployment change"))
graph addplot histogram log_coni_assoc_1999, ///
	yaxis(2) ///
	yscale(range(0 10) off axis(2)) ///
	xlabel(0.4(0.3)1.2) ///
	color(black%10) ///
		legend( ///
			region(lwidth(none)) ///
			col(3) ///
			position(6) ///
			order(4 "Low unemployment change" 5 "Mid unemployment change" 6 "High unemployment change"))
graph export "$folder/replication/figures/figA1d.pdf", replace

